package com.cole.gx095.Repository;

import com.cole.gx095.entity.Admininfo;
import com.cole.gx095.entity.SaleGroup;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SaleGroupRepository extends JpaRepository<SaleGroup,Integer>, JpaSpecificationExecutor<SaleGroup> {
    @Query(value = "select * from salegroup s where s.saleperson=?1",nativeQuery = true)
    SaleGroup findBysaleperson(String saleperson);

    @Query(value = "select * from salegroup s where s.status = 0",nativeQuery = true)
    List<SaleGroup> findAllBystatus();
}
